<template>
  <div class="icon-layout">
    <div class="btn">
      <div v-for="icon in componentData.icon" :key="icon.id" class="btn-item">
        <img
          :src="icon.url"
          :style="{
            filter: `drop-shadow(${componentData.defaultColor} 16vw 0)`,
          }"
          alt=""
        />
        <span
          class="ft-8 mt-10"
          :style="{
            color: componentData.defaultColor,
          }"
        >
          {{ icon[`title${capitalizeLang}`] }}
        </span>
        <span
          class="ft-8"
          :style="{
            color: componentData.defaultColor,
          }"
        >
          {{ icon[`subtitle${capitalizeLang}`] }}
        </span>
      </div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  props: {
    componentData: {
      type: Object,
      default: () => ({}),
    },
  },
  data() {
    return {}
  },
  computed: {
    ...mapGetters(['capitalizeLang']),
  },
  methods: {},
}
</script>

<style lang="less" scoped>
@import '~assets/var';

.icon-layout {
  position: relative;
  min-height: 100px;
  background-color: #f6f7f9;

  .btn {
    display: flex;
    color: #0261bc;
    flex-wrap: wrap;
    padding: 14px 54px;
    font-size: 20px;
    transform: translateZ(0);

    .btn-item {
      display: flex;
      flex-direction: column;
      text-align: center;
      overflow: hidden;
      position: relative;
      width: 160px;
      padding: 36px 4px;

      & + .btn-item {
        &::after {
          content: '';
          width: 2px;
          height: 90px;
          display: block;
          position: absolute;
          left: 0;
          top: 50%;
          transform: translateY(-50%);
          border-left: 1px solid;
          border-image: linear-gradient(
            360deg,
            rgba(255, 255, 255, 0),
            rgba(149, 186, 230, 1),
            rgba(255, 255, 255, 0)
          )
            1 1;
        }

        &::before {
          content: '';
          width: 90px;
          height: 1px;
          display: block;
          position: absolute;
          left: 50%;
          top: 0;
          transform: translateX(-50%);
          border-top: 1px solid;
          border-image: linear-gradient(
            90deg,
            rgba(255, 255, 255, 0),
            rgba(149, 186, 230, 1),
            rgba(255, 255, 255, 0)
          )
            1 1;
        }
      }

      &:nth-child(2),
      &:nth-child(3),
      &:nth-child(4) {
        &::before {
          display: none;
        }
      }

      &:nth-child(5) {
        &::after {
          display: none;
        }
      }

      img {
        width: 70px;
        height: 70px;
        transform: translateX(-16vw);
        display: block;
        margin: 0 auto;
        // margin-left: -10vw;
        // transform: translateZ(0);
      }

      .ft-8 {
        font-size: 32px;
        line-height: 32px;
        margin-top: 8px;
        display: inline-block;
        zoom: 0.5;
        word-break: break-word;
      }

      .mt-10 {
        margin-top: 30px;
      }
    }
  }
}
</style>
